"""
URL configuration for ROOT project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.urls import path, include
from rest_framework import routers
from .kc_views.get_product import GetProduct
from apps.ipo.kc_views.login import KcObtainAuthToken
from apps.ipo.kc_views.upload import Upload
from apps.ipo.kc_views.ipo import IpoImages, IpoAccuracy
from apps.ipo.kc_views.get_images_list import GetImagesList
from apps.ipo.kc_views.get_ipo_images_list import GetIpoImagesList

router = routers.SimpleRouter()
router.register(r'load_images', GetImagesList)
router.register(r'load_ipo_images', GetIpoImagesList)

urlpatterns = [
    path('api/login/token/', KcObtainAuthToken.as_view()),
    # 图片上传
    path('api/upload/uploadFile/', Upload.as_view()),
    # 更新聚水潭图像库
    path("api/get/product/", GetProduct.as_view()),
    # 对比本地图片
    path("api/ipo/images/", IpoImages.as_view()),
    path("api/ipo/accuracy/", IpoAccuracy.as_view()),
    # 图库列表
    path('api/', include(router.urls)),
]
